1. Field of the Invention
Method and apparatuses consistent with the present invention relate to intra prediction of an image, and particularly, intra prediction coding and decoding of an image for improving a coding rate and reducing a complexity of intra prediction by performing the intra prediction according to a selected intra prediction mode based on a direction of an input image.
2. Description of the Related Art
H.264/MPEG-4 advanced video coding (H.264/MPEG-4 AVC), which is a digital video coding standard for achieving very high data compression, adopts various techniques for improving compression rate such as multiple reference motion compensation, loop filtering, variable block size motion compensation, entropy coding such as context-based adaptive binary arithmetic coding (CABAC), and so on.
According to H.264, a picture is divided into macroblocks in order to code the picture. After coding each macroblock in all the available coding modes in inter prediction and intra prediction, the appropriate coding mode for coding macroblock is determined based on a bit-rate of coding the macroblock and a distortion between a decoded macroblock and an original macroblock.
In intra prediction, in order to code a block of a current picture, a reference picture is not used, but a predicted value of a current block to be coded using a spatially neighboring pixel value of the current block is calculated and the difference value between the predicted value and a real pixel value is coded. In this case, intra prediction modes are divided into 4×4 intra prediction modes, 8×8 intra prediction modes (in case of high profile), 16×16 intra prediction modes of a luminance component, and intra prediction modes of a chrominance component.
FIG. 1 shows 16×16 intra prediction modes of a luminance component in accordance with the H.264 standard, and FIG. 2 shows 4×4 intra prediction modes of a luminance component in accordance with the H.264 standard.
Referring to FIG. 1, 16×16 intra prediction modes are divided into four modes including a vertical mode, a horizontal mode, a direct current (DC) mode, and a plane mode. Referring to FIG. 2, 4×4 intra prediction modes are divided into 9 modes including a vertical mode, a horizontal mode, a DC mode, a diagonal down-left mode, a diagonal down-right mode, a vertical right mode, a vertical left mode, a horizontal-up mode, and a horizontal-down mode.
For example, according to Mode 0, that is the vertical mode in FIG. 2, prediction coding of a 4×4 current block is explained. First, pixel values of upward pixels A to D bordering a top row of the 4×4 current block are predicted as pixel values of the 4×4 current block. That is, pixel value A is predicted as four pixel values of the first column of the current block, pixel value B is predicted as four pixel values of the second column of the current block, pixel value C is predicted as four pixel values of the third column of the current block, and pixel value D is predicted as 4 pixel values of the fourth column of the current block. Then, after obtaining the difference values between a 4×4 current block predicted using the pixels A to D and the original 4×4 current block, the difference values are coded.
In coding an image in accordance with the H.264 standard, after coding the current macroblock using 13 modes including the 4×4 intra prediction modes and 16×16 intra prediction modes, intra prediction coding is performed using the mode in which a rate-distortion cost (RD cost) is minimized. Specifically, the 16×16 intra prediction mode in which the RD cost is minimized is selected from the four 16×16 intra prediction modes by performing the four 16×16 intra prediction modes on the current macroblock, and the mode in which the RD cost is minimized for each sub-block is selected by additionally performing the nine 4×4 intra prediction modes in turns for each 4×4 sub-block. Then, the intra prediction mode in which the RD cost is minimized is selected by comparing the RD cost of the selected 16×16 intra prediction mode with the RD cost of the 4×4 intra prediction modes that is the sum of the RD costs of the sub-blocks. Accordingly, in conventional intra prediction coding, there is an associated drawback in that a large number of similar operations are repeated for determining one intra prediction mode. Thus, the compression rate increases, but the number and complexity of operations also increases.